#!/usr/bin/python
# -*- coding: utf-8 -*-
#Author: Onur ASLAN
#Mail : hata.pindir@gmail.com 


from PyQt4 import QtCore
from PyQt4 import QtGui

from Ui_MainWindow import Ui_MainWindow
import os, getpass
import gdata.youtube, getpass
import gdata.youtube.service

#http://www.youtube.com/get_video_info?&video_id=4o29VoxtsFk


yt_service = gdata.youtube.service.YouTubeService()
yt_service.ssl = True


dosyaa = open("/home/"+str(getpass.getuser())+"/.pindir_video_id.txt")
for satir in dosyaa:
    videoID = satir

	    	
entry = yt_service.GetYouTubeVideoEntry(video_id=videoID)

videoTitle = entry.media.title.text
videoUploadTime = entry.published.text
videoDescription = entry.media.description.text
videoCategory = entry.media.category[0].text
videoLabel = entry.media.keywords.text
videoWatchPage = entry.media.player.url
videoDuration= entry.media.duration.seconds
videoViewCount = entry.statistics.view_count



#for thumbnail in entry.media.thumbnail:
#  print 'Thumbnail url: %s' % thumbnail.url
  

